home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / games / lorri4.zip / GUARD.SCR < prev    next >
Text File  |  1995-09-24  |  5KB  |  211 lines

  1. !
  2. ! Default Guard's script
  3. !
  4. ! (c) DC Software, 1989-1995
  5. !
  6. ! Pending Enhancements
  7. !
  8. ! - I need to create a voice file (.VFL) with voices for this script.
  9. !   Look at the 'voice()' entries to see what voices it would play if
  10. !   they were available.  These voices could even be placed in the
  11. !   system's voice file (DCSOUNDS.VFL) in which case the voice command
  12. !   should read 'voice( xxxx, 1000 )'.
  13. !
  14.  
  15. !------------------------------------------------------------------------!
  16. :@TALK ! Talk to the character !
  17. !------------------------------------------------------------------------!
  18.  
  19.   if player.hp = 0 then
  20.     writeln( player.name, " is dead!" );
  21.     STOP;
  22.   endif;
  23.  
  24.   if npc.picture >= 0 then
  25.     viewpcx(npc);
  26.   endif;
  27.  
  28.   loadtext( npc.text ); ! Get the NPC's text block !
  29.   loadvfl( npc.voice ); ! Get the NPC's voice block !
  30.  
  31.   if npc.v1 = 1 then
  32.     writeln( "Hello again.  How may I help you?" );
  33.     GOTO CHAT;    ! Once a password is given, just talk !
  34.   endif;
  35.  
  36.   if npc.v1 = 2 then
  37.     writeln( "Can't you see I'm off duty?  Get lost.." );
  38.     GOTO CHAT1;
  39.   endif;
  40.  
  41.   if npc.v0 = 0 then
  42.     writeln( "Halt!  Identify yourself!" );
  43.     voice( "Halt1" );
  44.   else
  45.     writeln( "I told you to get lost!  What are you doing back here?" );
  46.     voice( "Halt2" );
  47.   endif;
  48.  
  49.   npc.v0 = 1;   ! We've been here !
  50.   L0 = 0;       ! Count number of bribe attempts !
  51.   L1 = 0;       ! Count number of password attempts !
  52.  
  53. :LOOP
  54.   L3 = select( "Leave","Fight Guard","Give Money","Give Password","Talk" );
  55.   ON L3 GOTO XLEAVE, XFIGHT, BRIBE, PSWRD, TRYCHAT;
  56.  
  57. :XLEAVE
  58.   writeln( "And don't come back!" );
  59.   goto XSTOP;
  60.  
  61. :TRYCHAT
  62.   writeln( "No unauthorized person is allowed in this area.." );
  63.   writeln( "Please leave." );
  64.   goto LOOP;
  65.  
  66. !
  67. ! Fight with the guard..
  68. !
  69. :@ATTACK   !- Guards handle their own ATTACK -!
  70. :XFIGHT
  71.   writeln( "You asked for it!" );
  72.   voice( "Fight" );
  73.   npc.type = HOSTILE;
  74.   ! Don't forget to restore the picture !
  75.   if npc.picture >= 0 then
  76.     paint(window); ! Assumes the picture fits in the window !
  77.   endif;
  78.   FIGHT;
  79.  
  80. !
  81. ! Bribe the guard..
  82. !
  83. :BRIBE
  84.   if npc.value = 0 GOTO NOBRIBE; ! Can't bribe this guy.. !
  85.  
  86.   writeln( "You try to bribe the guard.." );
  87.   L4 = getnum("How much do you give?") * 10; ! Convert GOLD to silver !
  88.  
  89.   if L4 < npc.value then
  90.     writeln( "It would take a LOT more than ", $L4, " gold pieces.." );
  91.     voice( "More" );
  92.     goto LOOP;
  93.   endif;
  94.  
  95.   if L4 > group.gold then
  96.     writeln( "You don't have enough gold." );
  97.     voice( "Broke" );
  98.     goto LOOP;
  99.   endif;
  100.  
  101.   writeln( "Now that I think about it, it's time for my break.." );
  102.   voice( "Bribe" );
  103.   dec( group.gold, L4 );
  104.   npc.v1 = 2;
  105.   goto XSTOP;
  106.  
  107. :NOBRIBE
  108.   if L0 > 0 GOTO XFIGHT;
  109.   writeln( "Leave now, before I get really mad.." );
  110.   voice( "NoBribe" );
  111.   inc( L0 );
  112.   goto LOOP;
  113.  
  114. !
  115. ! Give the password
  116. !
  117. :PSWRD
  118.  
  119.   writeln( "What is the password?" );
  120.   L3 = getstr(); ! The Password !
  121.   if s4 for 8 = s0 then
  122.     writeln( "Thank you. You are now authorized to pass." );
  123.     voice( "Pass" );
  124.     npc.v1 = 1;              ! Disactivates guard feature !
  125.     goto XSTOP;
  126.   endif;
  127.  
  128.   ON L1 GOTO PSWRD1,PSWRD2,PSWRD3;
  129.   writeln( "I warned you!" );
  130.   voice( "Fight" );
  131.   FIGHT;
  132.  
  133. :PSWRD1
  134.   writeln( "You'd better leave now.." );
  135.   voice( "NoPass" );
  136.   inc(L1);
  137.   GOTO LOOP;
  138.  
  139. :PSWRD2
  140.   writeln( "Trying to guess the password is a bad idea.." );
  141.   voice( "NoPass" );
  142.   inc(L1);
  143.   GOTO LOOP;
  144.  
  145. :PSWRD3
  146.   writeln( "This was your last chance.  Leave now!" );
  147.   voice( "NoPass" );
  148.   inc(L1);
  149.   GOTO LOOP;
  150.  
  151. !
  152. ! Handle conversations..
  153. !
  154. :CHAT
  155.   writeln( "How may I help you?.  Please make it brief, I'm on duty." );
  156.  
  157. :CHAT1
  158.   L3 = getstr("Name","Password","Job","Bye");
  159.   if L3 = -1 then 
  160.     writeln( "Ok." );
  161.     goto XSTOP;
  162.   endif;
  163.  
  164. ! First, see if the keyword typed is in the character's text block !
  165.   if dotext( S0 ) then
  166.     if L3 = 3 goto XSTOP;
  167.     goto CHAT1;
  168.   endif;
  169.  
  170. ! It didn't, so try the predefined ones..
  171.   on L3 goto CNAME, CPASS, CJOB, CSTOP;
  172.  
  173. ! Nope, try a 'DEFAULT' line
  174.   if not dotext( "DEFAULT" ) then
  175.     writeln( "I don't know anything about that!" );
  176.   endif;
  177.   goto CHAT1;
  178.  
  179. :CNAME
  180.    writeln( "My name is ", NPC.name, "."     );
  181.    GOTO CHAT1;
  182.  
  183. :CPASS
  184.    if npc.v1 = 2 then
  185.      writeln( "Can't you see I'm busy?" );
  186.    else
  187.      writeln( "You only have to give it once." );
  188.    endif;
  189.    GOTO CHAT1;
  190.  
  191. :CJOB
  192.    writeln( "I am a guard!"                  );
  193.    GOTO CHAT1;
  194.  
  195. :CSTOP
  196.    writeln( "You're welcome.."               );
  197.    goto XSTOP;
  198.  
  199. ! Feel free to expand on this list.. !
  200.  
  201. !-----------------------------------------------------------------!
  202. ! All STOPs now lead here so the screen can be restored if needed !
  203. !-----------------------------------------------------------------!
  204. :XSTOP
  205.   if npc.picture >= 0 then
  206.     paint(window); ! Assumes the picture fits in the window !
  207.   endif;
  208.   stats(-1); ! Refresh Statistics !
  209.   STOP;
  210.  
  211.